// PatternSetterDlg.h : header file
//

#if !defined(AFX_PATTERNSETTERDLG_H__E1893D97_E561_4A2E_822D_8F2CEA7CB9D5__INCLUDED_)
#define AFX_PATTERNSETTERDLG_H__E1893D97_E561_4A2E_822D_8F2CEA7CB9D5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CPatternSetterDlg dialog
#include "StaticScene.h"
#include "Resizer.h"	// Added by ClassView
#include "resource.h"
#include "LabelEx.h"
#include "StaticZuoCheng.h"
#include "AdoTool.h"
#include <vector>
#include <string>
#include "afxwin.h"
using namespace std;

struct  SIZEINFO
{
	string strSizeId;
	int strx;
	int stry;
	int strSizeWidth;
	int strSizeHeight;
	string strisTitle;
};

struct POSITIONINFO
{
	string strSizeId;
	string strSizeName;
	string strSizeWidth;
	string strSizeHeight;
	string strSizeCode;
};

class CPrmReConfigListItemIfno;
class CPatternSetterDlg : public CDialog
{
// Construction
public:
	CPatternSetterDlg(CWnd* pParent = NULL);	// standard constructor
	~CPatternSetterDlg();
	typedef enum
	{
		CREATE_LABELS,UPDATE_LABELS
	} LABELFLAGS;
// Dialog Data
	//{{AFX_DATA(CPatternSetterDlg)
	enum { IDD = IDD_PATTERNSETTER_DIALOG };
	CButton	m_btCancel;
	CButton	m_btOk;
	CStatic	m_staticContainer;
	CStaticScene	m_staticSceneDS1;
	CStaticScene	m_staticSceneDS2;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPatternSetterDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL
public:
	CPoint CalulateNewAreaTopPoint(int nx,int ny,BYTE bySide=1);
	CPoint CalulateNewAreaTopPoint(const CRect &rect,BYTE bySide=1);
	BOOL IsNewAreaUsed(int m_nUniqueId,const CRect &rectArea,CString &strMianId);
public:
	vector<CLabelEx*>		m_arrLabels;
	vector<CStaticZuoCheng*> m_arrButtons;
	int m_nOldSize;
	BOOL m_HaveTitle;
	CRect m_editedRect;
	CObArray m_arrXiaoSizeList;
	CObArray m_arrDaSizeList;
	CMapStringToString m_mapSize;
	CMapStringToOb     m_mapPage;
	CString m_strMianId;
	CMenu	m_menu;
	CString m_strSelectedPage;
	CString m_strMianIdCopy;
	CString m_strPageFlagCopy;
	BOOL    m_bChanged;

public:
	CResizer m_resizer;
	void InitLabelsInfo();
	void InitPositionInfo();
	void DisplayLabels(LABELFLAGS nFlag,CString &strMianId);
	void ClearButtons();
	void ClearLabels();
	void DisplayPositions();

	void InitDaSizeList();
// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CPatternSetterDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
		void SetMainComponentResizeProperty();
public:
// 	CStaticScene m_staticSceneDS3;
// 	CStaticScene m_staticSceneDS4;
// 	CStaticScene m_staticSceneDS5;
// 	CStaticScene m_staticSceneDS6;
// 	CStaticScene m_staticSceneDS7;
// 	CStaticScene m_staticSceneDS8;
public:
	CComboBox m_comDaSizeList;
public:
	afx_msg void OnCbnSelchangeComboPatternsize();
	void InitPageNumButtons(int nButton);
public:
	afx_msg void OnBnClickedButtonPage1();
public:
	afx_msg void OnBnClickedButtonPage2();
public:
	afx_msg void OnBnClickedButtonPage3();
public:
	afx_msg void OnBnClickedButtonPage4();
public:
	afx_msg void OnBnClickedButtonPage5();
public:
	afx_msg void OnBnClickedButtonPage6();
public:
	afx_msg void OnBnClickedButtonPage7();
public:
	afx_msg void OnBnClickedButtonPage8();
public:
	afx_msg void OnBnClickedButtonPage9();
public:
	afx_msg void OnBnClickedButtonPage10();
public:
	afx_msg void OnBnClickedButtonPage11();
public:
	afx_msg void OnBnClickedButtonPage12();
	void UpdateLabels(CString &strMianId);
	void SavePatterns();
	int GetSizeGroupId();
public:
	afx_msg void OnBnClickedButtonDenglu();
public:
	CComboBox m_comMianFrom;
public:
	CComboBox m_comPageFrom;
public:
	CComboBox m_comMianTo;
public:
	CComboBox m_comPageTo;
public:
	afx_msg void OnBnClickedButtonCopy();
	void ShowMenu(int nx,int ny);
public:
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
public:
	afx_msg void OnManualClearcurrentpage();
public:
	afx_msg void OnManualClearcurrentmian();
public:
	afx_msg void OnManualClearall();
public:
	afx_msg void OnManualCopycurrentpage();
public:
	afx_msg void OnManualCopycurrentmian();
public:
	afx_msg void OnManualPaste();
	void ClearPageOrMian(CString strMianId,CString strPageFlag);
	void ClearSizeList();
	void ShowSuccessful(byte by=1);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PATTERNSETTERDLG_H__E1893D97_E561_4A2E_822D_8F2CEA7CB9D5__INCLUDED_)
